package com.ngc.mall.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ngc.mall.common.configure.mybatisPlus.BaseServiceImpl;
import com.ngc.mall.domain.CouponTemplateDomain;
import com.ngc.mall.mapper.CouponTemplateMapper;
import com.ngc.mall.service.ICouponTemplateService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CouponTemplateServiceImpl extends BaseServiceImpl<CouponTemplateMapper, CouponTemplateDomain> implements ICouponTemplateService {

    @Override
    public Long createCouponTemplate(CouponTemplateDomain domain){
        return super.create(domain);
    }

    @Override
    public List<CouponTemplateDomain> findAll() {
        return super.list();
    }

    @Override
    public Boolean updateTemplateById(Long id, CouponTemplateDomain domain) {
        return super.update(domain, Wrappers.<CouponTemplateDomain>lambdaUpdate().eq(CouponTemplateDomain::getId,id));
    }

    @Override
    public Boolean deleteTemplateById(Long id) {
        return super.removeById(id);
    }



}
